<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="refresh" content="15;URL='/overview.html'">
    <title>Overview</title>
    <link rel="stylesheet" type="text/css" href="style.css">
    <script type="text/javascript">
    // Testing JSON
    function readJSON() {
        var myJSONobject = {};
        var http_request = new XMLHttpRequest();
        http_request.open('GET', '/dummyperson', true);
        http_request.onreadystatechange = function () {
            var done = 4, ok = 200;
            if (http_request.readyState == done && http_request.status == ok) {
                myJSONobject = JSON.parse(http_request.responseText);
                alert(myJSONobject.firstName  + " " + myJSONobject.lastName);
            }
        };
        http_request.send(null);
    }
    // Client side include of HTML table
    // http://www.boutell.com/newfaq/creating/include.html
    function clientSideInclude(id, url) {
        var element = document.getElementById(id);
        if (!element) {
            alert("Bad id " + id + "passed to clientSideInclude. You need a div or span element with this id in your page.");
            return;
        }
        var req = false;
        // For Safari, Firefox, and other non-MS browsers
        if (window.XMLHttpRequest) {
            try {
                req = new XMLHttpRequest();
            } catch (e) {
                req = false;
            }
        }
        if (req) {
            // Synchronous request, wait till we have it all
            req.open('GET', url, false);
            req.send(null);
            element.innerHTML = req.responseText;
        } else {
            element.innerHTML = "Sorry, your browser does not support XMLHTTPRequest objects. This page requires Internet Explorer 5 or better for Windows, " +
            "or Firefox for any system, or Safari. Other compatible browsers may also exist.";
        }
    }
    // page loaded
    function pageLoaded() {
        clientSideInclude('aircraftsTable', './aircraftsHtml')
    }
    </script>
  </head>
  <body onload="pageLoaded();">
    <h1>
      Aircrafts
    </h1>
    <a href="./overview.html">Reload</a> | <script language="javascript">document.write(Date());</script>
    <div id="aircraftsTable"></div>
    <h1>
      KML models
    </h1>
        <ol>
            <li><a href="./kml/PlaneTriangle.dae">PlaneTriangle.dae</a></li>
            <li><a href="./kml/PlaneTriangle.dae">PlaneTriangle.skp</a></li>
        </ol>
    <h1>
      Tests
    </h1>
    <ol>
      <li>Show dummy JSON person data, no FSX required <a href="./dummyperson/">[GO]</a></li>
      <li>Read dummy person data via JSON and Javascript, no FSX required <a href="javascript:readJSON()">[GO]</a></li>
      <li>Show raw aircrafts JSON data, FSX required <a href="./aircraftsJson">[GO]</a> | No waypoints <a href="./aircraftsJson?withwaypoints=false">[GO]</a></li>
      <li>Test if FMC data are attached: <a href="./SIDSTARS/EDDF.txt">EDDF SIDs / STARs</a>. User must license the data with <a href="http://fsxws.codeplex.com/wikipage?title=Legal">authorized dealer</a>.</li>
    </ol>
    <h1>
      Query parameters
    </h1>
    <ul>
      <li>id .. aircraft id
      <li>test.. true (or not set passed) JSON data just true wor availability
      <li>withwaypoints .. JSON data with/without waypoints
      <li>waypointresolution .. (reduced) waypoint resolution [ms]
      <li>waypointsmax .. max number of waypoints
      <li>reload .. true | false decides whether a KML file (false) or a KML NetworkLink (true) will be created
    </ul>
    <hr/>
    Software license and legal information, <a href="http://fsxws.codeplex.com/wikipage?title=Legal">see here</a>
  </body>
</html>
